package com.itheima.io1.mytest;

import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

/**
 * @author zhangbaiyan
 * @date 2024-09-21 18:05
 * @description:
 * @version:
 */
public class test10 {
    public static void main(String[] args) throws IOException {
        FileReader fr = new FileReader(new File("l.txt"), Charset.forName("GBK"));
        FileWriter fw = new FileWriter("i.txt", StandardCharsets.UTF_8);
        char[] chars = new char[1024];
        int len;
        while ((len = fr.read(chars)) != -1) {
            fw.write(chars, 0, len);
        }
       fw.close();
        fr.close();
    }
}
